package request

import (
	"gitee.com/cjsn/topsdk/ability654/domain"
	"gitee.com/cjsn/topsdk/util"
)

type TmallServicecenterWorkcardStatusUpdateRequest struct {
	/*
	   api调用者     */
	Updater *string `json:"updater" required:"true" `
	/*
	   买家id     */
	BuyerId *int64 `json:"buyer_id,omitempty" required:"false" `
	/*
	   服务生效时间 ：工单类型为合同工单时，必选！     */
	EffectDate *int64 `json:"effect_date,omitempty" required:"false" `
	/*
	   工单id     */
	WorkcardId *int64 `json:"workcard_id" required:"true" `
	/*
	   服务失效时间 ：工单类型为合同工单时，必选！     */
	ExpireDate *int64 `json:"expire_date,omitempty" required:"false" `
	/*
	   目前仅支持5种状态的反馈：3=授理， 10=拒绝 ，4=执行 ，5=成功，11=失败。（所有状态列表： -1： 初始化 0： 生成 1： 生效 2： 申请 3： 受理 4： 执行 5： 成功 9： 结算 10： 拒绝 11： 失败 12 ： 撤销 13： 暂停 19： 终止）     */
	Status *byte `json:"status" required:"true" `
	/*
	   更新时间     */
	UpdateDate *int64 `json:"update_date" required:"true" `
	/*
	   工单类型： 2（合同） 或者 1(任务）     */
	Type *byte `json:"type" required:"true" `
	/*
	   备注,256个字符以内     */
	Comments *string `json:"comments,omitempty" required:"false" `
	/*
	   任务类工单，预约或者上门地址     */
	Address *string `json:"address,omitempty" required:"false" `
	/*
	   任务执行，预约联系人     */
	ContactName *string `json:"contact_name,omitempty" required:"false" `
	/*
	   任务执行，预约联系人电话     */
	ContactPhone *string `json:"contact_phone,omitempty" required:"false" `
	/*
	   服务预约时间     */
	ServiceDate *int64 `json:"service_date,omitempty" required:"false" `
	/*
	   服务完成时间     */
	CompleteDate *int64 `json:"complete_date,omitempty" required:"false" `
	/*
	   服务凭证上传的图片URL链接，多个以;隔开     */
	ServiceVoucherPics *string `json:"service_voucher_pics,omitempty" required:"false" `
	/*
	   属性定义。例如无忧退货服务，K-V对定义，每对KV用“;”分割，“:”号左边是key右边是value，value如果有多个则以“,”分割。 reasons   :  原因，可能有多个 succeedCount     :    取件成功个数 failedCount    :    取件失败个数 cancelCount      :     取件取消个数 totalCount       :      总取件个数，totalCount= succeedCount + failedCount + cancelCount     */
	Attribute *string `json:"attribute,omitempty" required:"false" `
	/*
	   服务商网点内部编码     */
	ServiceCenterCode *string `json:"service_center_code,omitempty" required:"false" `
	/*
	   服务商网点名字     */
	ServiceCenterName *string `json:"service_center_name,omitempty" required:"false" `
	/*
	   单元是分     */
	ServiceFee *int64 `json:"service_fee,omitempty" required:"false" `
	/*
	   是否上门     */
	IsVisit *bool `json:"is_visit,omitempty" required:"false" `
	/*
	   说明     */
	BeforeServiceMemo *string `json:"before_service_memo,omitempty" required:"false" `
	/*
	   说明     */
	AfterServiceMemo *string `json:"after_service_memo,omitempty" required:"false" `
	/*
	   手机号码     */
	PhoneImei *string `json:"phone_imei,omitempty" required:"false" `
	/*
	   服务子状态：30 表示“服务已申请（上门）” 31表示“服务改约（上门）” 400表示“服务结果（待件上门）” 410表示“服务结果（拖机维修）” 411表示“服务结果（换机）” 420表示“服务结果（上门不可维修）”     */
	SubStatus *int64 `json:"sub_status,omitempty" required:"false" `
	/*
	   网点负责人联系电话     */
	ServiceCenterManagerPhone *string `json:"service_center_manager_phone,omitempty" required:"false" `
	/*
	   网点负责人     */
	ServiceCenterManagerName *string `json:"service_center_manager_name,omitempty" required:"false" `
	/*
	   网点地址     */
	ServiceCenterAddress *string `json:"service_center_address,omitempty" required:"false" `
	/*
	   一个工单可能包含多件商品，比如空调可能有两台，录入每天机器的安装情况     */
	WorkCardInstallDetailList *[]domain.TmallServicecenterWorkcardStatusUpdateWorkCardInstallDetail `json:"work_card_install_detail_list,omitempty" required:"false" `
	/*
	   json string。费用单位为分     */
	ServiceFeeDetail *string `json:"service_fee_detail,omitempty" required:"false" `
	/*
	   物流单号     */
	ExpressCode *string `json:"express_code,omitempty" required:"false" `
	/*
	   物流公司名字     */
	ExpressCompany *string `json:"express_company,omitempty" required:"false" `
}

func (s *TmallServicecenterWorkcardStatusUpdateRequest) SetUpdater(v string) *TmallServicecenterWorkcardStatusUpdateRequest {
	s.Updater = &v
	return s
}
func (s *TmallServicecenterWorkcardStatusUpdateRequest) SetBuyerId(v int64) *TmallServicecenterWorkcardStatusUpdateRequest {
	s.BuyerId = &v
	return s
}
func (s *TmallServicecenterWorkcardStatusUpdateRequest) SetEffectDate(v int64) *TmallServicecenterWorkcardStatusUpdateRequest {
	s.EffectDate = &v
	return s
}
func (s *TmallServicecenterWorkcardStatusUpdateRequest) SetWorkcardId(v int64) *TmallServicecenterWorkcardStatusUpdateRequest {
	s.WorkcardId = &v
	return s
}
func (s *TmallServicecenterWorkcardStatusUpdateRequest) SetExpireDate(v int64) *TmallServicecenterWorkcardStatusUpdateRequest {
	s.ExpireDate = &v
	return s
}
func (s *TmallServicecenterWorkcardStatusUpdateRequest) SetStatus(v byte) *TmallServicecenterWorkcardStatusUpdateRequest {
	s.Status = &v
	return s
}
func (s *TmallServicecenterWorkcardStatusUpdateRequest) SetUpdateDate(v int64) *TmallServicecenterWorkcardStatusUpdateRequest {
	s.UpdateDate = &v
	return s
}
func (s *TmallServicecenterWorkcardStatusUpdateRequest) SetType(v byte) *TmallServicecenterWorkcardStatusUpdateRequest {
	s.Type = &v
	return s
}
func (s *TmallServicecenterWorkcardStatusUpdateRequest) SetComments(v string) *TmallServicecenterWorkcardStatusUpdateRequest {
	s.Comments = &v
	return s
}
func (s *TmallServicecenterWorkcardStatusUpdateRequest) SetAddress(v string) *TmallServicecenterWorkcardStatusUpdateRequest {
	s.Address = &v
	return s
}
func (s *TmallServicecenterWorkcardStatusUpdateRequest) SetContactName(v string) *TmallServicecenterWorkcardStatusUpdateRequest {
	s.ContactName = &v
	return s
}
func (s *TmallServicecenterWorkcardStatusUpdateRequest) SetContactPhone(v string) *TmallServicecenterWorkcardStatusUpdateRequest {
	s.ContactPhone = &v
	return s
}
func (s *TmallServicecenterWorkcardStatusUpdateRequest) SetServiceDate(v int64) *TmallServicecenterWorkcardStatusUpdateRequest {
	s.ServiceDate = &v
	return s
}
func (s *TmallServicecenterWorkcardStatusUpdateRequest) SetCompleteDate(v int64) *TmallServicecenterWorkcardStatusUpdateRequest {
	s.CompleteDate = &v
	return s
}
func (s *TmallServicecenterWorkcardStatusUpdateRequest) SetServiceVoucherPics(v string) *TmallServicecenterWorkcardStatusUpdateRequest {
	s.ServiceVoucherPics = &v
	return s
}
func (s *TmallServicecenterWorkcardStatusUpdateRequest) SetAttribute(v string) *TmallServicecenterWorkcardStatusUpdateRequest {
	s.Attribute = &v
	return s
}
func (s *TmallServicecenterWorkcardStatusUpdateRequest) SetServiceCenterCode(v string) *TmallServicecenterWorkcardStatusUpdateRequest {
	s.ServiceCenterCode = &v
	return s
}
func (s *TmallServicecenterWorkcardStatusUpdateRequest) SetServiceCenterName(v string) *TmallServicecenterWorkcardStatusUpdateRequest {
	s.ServiceCenterName = &v
	return s
}
func (s *TmallServicecenterWorkcardStatusUpdateRequest) SetServiceFee(v int64) *TmallServicecenterWorkcardStatusUpdateRequest {
	s.ServiceFee = &v
	return s
}
func (s *TmallServicecenterWorkcardStatusUpdateRequest) SetIsVisit(v bool) *TmallServicecenterWorkcardStatusUpdateRequest {
	s.IsVisit = &v
	return s
}
func (s *TmallServicecenterWorkcardStatusUpdateRequest) SetBeforeServiceMemo(v string) *TmallServicecenterWorkcardStatusUpdateRequest {
	s.BeforeServiceMemo = &v
	return s
}
func (s *TmallServicecenterWorkcardStatusUpdateRequest) SetAfterServiceMemo(v string) *TmallServicecenterWorkcardStatusUpdateRequest {
	s.AfterServiceMemo = &v
	return s
}
func (s *TmallServicecenterWorkcardStatusUpdateRequest) SetPhoneImei(v string) *TmallServicecenterWorkcardStatusUpdateRequest {
	s.PhoneImei = &v
	return s
}
func (s *TmallServicecenterWorkcardStatusUpdateRequest) SetSubStatus(v int64) *TmallServicecenterWorkcardStatusUpdateRequest {
	s.SubStatus = &v
	return s
}
func (s *TmallServicecenterWorkcardStatusUpdateRequest) SetServiceCenterManagerPhone(v string) *TmallServicecenterWorkcardStatusUpdateRequest {
	s.ServiceCenterManagerPhone = &v
	return s
}
func (s *TmallServicecenterWorkcardStatusUpdateRequest) SetServiceCenterManagerName(v string) *TmallServicecenterWorkcardStatusUpdateRequest {
	s.ServiceCenterManagerName = &v
	return s
}
func (s *TmallServicecenterWorkcardStatusUpdateRequest) SetServiceCenterAddress(v string) *TmallServicecenterWorkcardStatusUpdateRequest {
	s.ServiceCenterAddress = &v
	return s
}
func (s *TmallServicecenterWorkcardStatusUpdateRequest) SetWorkCardInstallDetailList(v []domain.TmallServicecenterWorkcardStatusUpdateWorkCardInstallDetail) *TmallServicecenterWorkcardStatusUpdateRequest {
	s.WorkCardInstallDetailList = &v
	return s
}
func (s *TmallServicecenterWorkcardStatusUpdateRequest) SetServiceFeeDetail(v string) *TmallServicecenterWorkcardStatusUpdateRequest {
	s.ServiceFeeDetail = &v
	return s
}
func (s *TmallServicecenterWorkcardStatusUpdateRequest) SetExpressCode(v string) *TmallServicecenterWorkcardStatusUpdateRequest {
	s.ExpressCode = &v
	return s
}
func (s *TmallServicecenterWorkcardStatusUpdateRequest) SetExpressCompany(v string) *TmallServicecenterWorkcardStatusUpdateRequest {
	s.ExpressCompany = &v
	return s
}

func (req *TmallServicecenterWorkcardStatusUpdateRequest) ToMap() map[string]interface{} {
	paramMap := make(map[string]interface{})
	if req.Updater != nil {
		paramMap["updater"] = *req.Updater
	}
	if req.BuyerId != nil {
		paramMap["buyer_id"] = *req.BuyerId
	}
	if req.EffectDate != nil {
		paramMap["effect_date"] = *req.EffectDate
	}
	if req.WorkcardId != nil {
		paramMap["workcard_id"] = *req.WorkcardId
	}
	if req.ExpireDate != nil {
		paramMap["expire_date"] = *req.ExpireDate
	}
	if req.Status != nil {
		paramMap["status"] = *req.Status
	}
	if req.UpdateDate != nil {
		paramMap["update_date"] = *req.UpdateDate
	}
	if req.Type != nil {
		paramMap["type"] = *req.Type
	}
	if req.Comments != nil {
		paramMap["comments"] = *req.Comments
	}
	if req.Address != nil {
		paramMap["address"] = *req.Address
	}
	if req.ContactName != nil {
		paramMap["contact_name"] = *req.ContactName
	}
	if req.ContactPhone != nil {
		paramMap["contact_phone"] = *req.ContactPhone
	}
	if req.ServiceDate != nil {
		paramMap["service_date"] = *req.ServiceDate
	}
	if req.CompleteDate != nil {
		paramMap["complete_date"] = *req.CompleteDate
	}
	if req.ServiceVoucherPics != nil {
		paramMap["service_voucher_pics"] = *req.ServiceVoucherPics
	}
	if req.Attribute != nil {
		paramMap["attribute"] = *req.Attribute
	}
	if req.ServiceCenterCode != nil {
		paramMap["service_center_code"] = *req.ServiceCenterCode
	}
	if req.ServiceCenterName != nil {
		paramMap["service_center_name"] = *req.ServiceCenterName
	}
	if req.ServiceFee != nil {
		paramMap["service_fee"] = *req.ServiceFee
	}
	if req.IsVisit != nil {
		paramMap["is_visit"] = *req.IsVisit
	}
	if req.BeforeServiceMemo != nil {
		paramMap["before_service_memo"] = *req.BeforeServiceMemo
	}
	if req.AfterServiceMemo != nil {
		paramMap["after_service_memo"] = *req.AfterServiceMemo
	}
	if req.PhoneImei != nil {
		paramMap["phone_imei"] = *req.PhoneImei
	}
	if req.SubStatus != nil {
		paramMap["sub_status"] = *req.SubStatus
	}
	if req.ServiceCenterManagerPhone != nil {
		paramMap["service_center_manager_phone"] = *req.ServiceCenterManagerPhone
	}
	if req.ServiceCenterManagerName != nil {
		paramMap["service_center_manager_name"] = *req.ServiceCenterManagerName
	}
	if req.ServiceCenterAddress != nil {
		paramMap["service_center_address"] = *req.ServiceCenterAddress
	}
	if req.WorkCardInstallDetailList != nil {
		paramMap["work_card_install_detail_list"] = util.ConvertStructList(*req.WorkCardInstallDetailList)
	}
	if req.ServiceFeeDetail != nil {
		paramMap["service_fee_detail"] = *req.ServiceFeeDetail
	}
	if req.ExpressCode != nil {
		paramMap["express_code"] = *req.ExpressCode
	}
	if req.ExpressCompany != nil {
		paramMap["express_company"] = *req.ExpressCompany
	}
	return paramMap
}

func (req *TmallServicecenterWorkcardStatusUpdateRequest) ToFileMap() map[string]interface{} {
	fileMap := make(map[string]interface{})
	return fileMap
}
